bitkeeper revision 1.1705.1.10 (42a95ea6cCTdfA7-Kmu3_gnUMEq0gw)
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 10 Jun 2005 09:34:30 +0000 (09:34 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Fri, 10 Jun 2005 09:34:30 +0000 (09:34 +0000)
user -> kernel syscall path must enable interrupts after all, since
it calls create_bounce_frame which can potentially fault. Thus we must
also test_all_events.
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/x86_64/entry.S

index 5c3e1a598a9ebd48c9feb4754c7da6b28ee67354..e213a706619e1eb87add99f2bb5905f839f5cecc 100644 (file)
         movq (reg),reg;
 
         ALIGN
-/* %rbx: struct vcpu, interrupts disabled */
+/* %rbx: struct vcpu */
 switch_to_kernel:
         leaq  VCPU_trap_bounce(%rbx),%rdx
         movq  VCPU_syscall_addr(%rbx),%rax
         movq  %rax,TRAPBOUNCE_eip(%rdx)
         movw  $0,TRAPBOUNCE_flags(%rdx)
         call  create_bounce_frame
+        jmp   test_all_events
 
-/* %rbx: struct vcpu */
+/* %rbx: struct vcpu, interrupts disabled */
 restore_all_guest:
         RESTORE_ALL
         testw $TRAP_syscall,4(%rsp)
@@ -38,7 +39,6 @@ restore_all_guest:
         popq  %r11                    # CS
         cmpw  $__GUEST_CS32,%r11
         popq  %r11                    # RFLAGS
-        cli                           # No interrupts after stack switch
         popq  %rsp                    # RSP
         je    1f
         sysretq
@@ -107,6 +107,7 @@ restore_all_xen:
  */
         ALIGN
 ENTRY(syscall_enter)
+        sti
         movl  $__GUEST_SS,24(%rsp)
         pushq %rcx
         pushq $0
@@ -117,7 +118,6 @@ ENTRY(syscall_enter)
         jz    switch_to_kernel
 
 /*hypercall:*/
-        sti
         movq  %r10,%rcx
         andq  $(NR_hypercalls-1),%rax
         leaq  hypercall_table(%rip),%r10